package com.zm.demo.core.leetcode;

import static java.lang.System.in;
import static java.lang.System.out;

/**
 * @author zoum
 * @create 2020/1/9 15:16
 */
public class UniquePaths {

    Integer min = Integer.MAX_VALUE;

    public int uniquePaths(int m, int n) {

        int[][]initT = new int[m][n];

        for (int i = 0; i < m; i++){
            initT[i][0] = 1;
        }

        for (int i = 0; i < n; i++){
            initT[0][i] = 1;
        }

        for (int i = 1; i < m; i++){
            for (int j = 1; j < n; j++){
                initT[i][j] = initT[i-1][j] + initT[i][j-1];
            }
        }

        return initT[m-1][n-1];

    }




    public static void main(String[]args){
        out.println(new UniquePaths().uniquePaths(7,3));
    }
}
